import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.UnsupportedEncodingException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.List;

import com.maszy.pos.PosFrame;
import com.maszy.service.PosService;

/**
 * 
 */

/** 
 * @作者 Jcuckoo 
 * @创建日期 2012-3-4 
 * @版本 V 1.0 
 */

public class test {
	//将RFID会员卡交易记录TXT文件录入数据库
	public void RFIDTxtToSQL(String str){
		File f = new File(str);
		System.out.println("RFID TXT文件名:"+str);
		try {
			FileReader fileReader = new FileReader(f);
			BufferedReader bufferReader = null;
			try {
				InputStreamReader read = new InputStreamReader(
						new FileInputStream(f), "GBK");
				bufferReader = new BufferedReader(read);
			} catch (UnsupportedEncodingException e1) {
				// TODO Auto-generated catch block
				e1.printStackTrace();
			}
			String sss;
			try {
				sss = bufferReader.readLine();
				List list = new ArrayList();
				while ((sss = bufferReader.readLine()) != null) {
					String[] a = sss.split("\t");
					list.add(a);
				}
				
				for (int i = 0; i < list.size(); i++) {
					PosService ps = new PosService();
					
				ps.addRfid((String[]) list.get(i));
				}

			} catch (IOException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}

		} catch (FileNotFoundException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
	public static void main(String args[]){
		test pf=new test();
		pf.RFIDTxtToSQL("c:/0_20120302110112.txt");
		
	}
}
